function nextTick() {
    return new Promise((resolve, reject) => {
        // DOM更新完成否
        if(typeof MutationObserver !== 'undefined') {
            const observer = new MutationObserver(() => {
                let res = fn()
                if (res instanceof Promise) {
                    res.then(resolve)
                } else {
                    resolve()
                }

                // fn().then(resolve)
                // resolve()
            })
            observer.observer(document.getElementById('app'), {attributes: true, childlist: true, subtree: true})
        }
})
}

